<html>
	<head>
		<title>Trombino - Evaluation étudiant</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="public/js/jquery.min.js"></script>
		<script type="text/javascript" src="public/js/d3.v2.js"></script>
		<script type="text/javascript">
		//tableau des raisons
		var arrRaisons = {0:"abscent", 1:"présent", 2:"retard", 3:"travail non fait"};

		
	
		function saveRaison($nom,$raison,$date,$auteur) {
		<?php	$sql = "INSERT INTO clique(nom, raison, date,auteur) VALUES ('$auteur', '$raison', NOW(),'houda') ";
	mysql_query($sql) or die('Requête invalide : ' . mysql_error());?>
					 
					 
				
		}
		
		
		</script>
		
		<style>
		.btn {
			cursor:pointer; 
		}
		.tof {
			width:200px; 
		}
		.good {
			color:green;
		}
		.bad {
			color:red;
		}
		.bar {
		  fill: steelblue;
		}
		</style>
		
	</head>
	<body >	
	<?php 
	echo "salut";
    $xml = simplexml_load_file("https://picasaweb.google.com/data/feed/base/user/113848708930851956597/albumid/5795380358275112865?alt=rss&kind=photo&hl=fr");
	$i=0;
	$connexion = mysql_connect("localhost", "root", "");
	mysql_select_db("trombino", $connexion);
	foreach ($xml->channel->item as $item){
		echo "<div id='etu_".$i."' >";
		$non=$item->title;
		echo "<img src='public/img/timeP.jpg' class='btn' onclick='saveRaison(\"$no\",\"présent\")' />";
		echo "<img src='public/img/timeR.jpg' class='btn' onclick='saveRaison(2,".$i.",\"$no\")' />";
		echo "<img src='public/img/timeA.jpg' class='btn' onclick='saveRaison(0,".$i.",\"$no\")' />";
		echo "<img id='etu_tof_".$i."' src='".$item->enclosure['url']."' class='tof' onclick='getRaison(".$i.")' />";
		if($i % 2 == 0) $c = 'good'; else $c = 'bad'; 
		echo "<div class='$c' id='etu_nom_".$i."'>".$item->title."</div>";
		
		//echo "<div id='etu_svg_".$i."'></div>";
		//echo "</div>";
		$i++;
		
	}

	?>
	</body>
</html>
